package com.winenine999.generator.dao;

import com.winenine999.model.Winery;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface WineryMapper {
    @Delete({
        "delete from winery",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into winery (id, name, ",
        "detail)",
        "values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, ",
        "#{detail,jdbcType=VARCHAR})"
    })
    int insert(Winery record);

    int insertSelective(Winery record);

    @Select({
        "select",
        "id, name, detail",
        "from winery",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("com.winenine999.generator.dao.WineryMapper.BaseResultMap")
    Winery selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Winery record);

    @Update({
        "update winery",
        "set name = #{name,jdbcType=VARCHAR},",
          "detail = #{detail,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Winery record);
}